package com.asiainfo.crm.core.common;

import java.util.List;

import org.apache.commons.lang.StringUtils;

public class CommonBusiUtil {

	public static List getTabCycleMenuList(String cycle_type,String state){
		
		String sqlcmd="SELECT CYCLE_ID AS code,CYCLE_ID AS name FROM TAB_CYCLE WHERE 1=1 ";
		if(StringUtils.isNotEmpty(cycle_type)){
			sqlcmd+=" AND CYCLE_TYPE= ? ";
		}
		if(StringUtils.isNotEmpty(state)){
			sqlcmd+=" AND STATE= ? ";
		}
		sqlcmd+=" ORDER BY CYCLE_ID DESC ";
		Object[] params = new Object[]{cycle_type,state};
		return SQLCommand.execQuery(sqlcmd, params, BaseData.class);
		
	}
	
	public static List getTabCycleMenuList(String cycle_type){
		return getTabCycleMenuList(cycle_type,null);
	}
}
